Skip to content

Conversation

@WendellAdriel
Copy link
Contributor

@WendellAdriel WendellAdriel commented Aug 19, 2025

Summary

  • TrackedEventBus: A new decorator class that records dispatched events while delegating to the real EventBus
  • Automatic Installation: EventBusTester now automatically wraps the EventBus with TrackedEventBus on construction
  • Dual Mode Support: The tester supports both tracked mode (handlers execute) and faked mode (handlers don't execute)
  • Backward Compatibility: Existing tests using preventEventHandling() continue to work as before
  • Merged Event Tracking: The EventBusTester now merges dispatched events from both TrackedEventBus and FakeEventBus, solving edge cases where components hold references to the old EventBus
  • Fixed assertDispatched() to properly fail when no events were dispatched

Fixes #1486

@WendellAdriel WendellAdriel changed the title feat(event-bus): support to make assertions on dispatched events even when the event bus was not faked feat(event-bus): support to make assertions on dispatched events when the event bus was not faked Aug 19, 2025
@WendellAdriel WendellAdriel mentioned this pull request Aug 19, 2025
2 tasks
@WendellAdriel
Copy link
Contributor Author

@brendt I'm seeing that one test failed, but when I check, it's not related to these changes, and on my local this specific test that's marked as failed is passing. And to get weirder, it's the same one failing from #1529 😅

@brendt
Copy link
Member

brendt commented Aug 20, 2025

As discussed, let's clean these PRs up and tackle them one by one instead of all at the same time.

@brendt brendt closed this Aug 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Even bus tester improvements

2 participants